home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Taifun
/
Taifun 045 (1988-02-15)(Ossowski, Stefan)(DE)(PD).zip
/
Taifun 045 (1988-02-15)(Ossowski, Stefan)(DE)(PD).adf
/
Iff2Pcs
/
Source
/
pzutil.c
< prev
next >
Wrap
Text File
|
1988-01-20
|
755b
|
43 lines
/* Various small utility routines for IFF2PCS.
** Ali Ozer, Nov 1987
*/
unsigned long TimeInSecs ()
{
unsigned long datevec[3];
DateStamp (&datevec[0]);
return (datevec[0] * 86400L + datevec[1] * 60L + datevec[2] / 50L);
}
static unsigned long rndseed;
void InitRnd ()
{
unsigned long datevec[3];
DateStamp (&datevec[0]);
rndseed = datevec[1] * datevec[2];
}
int RndInt (min, max)
int min, max;
{
long res = (rndseed & 0x00000002L) | (rndseed & 0x00000010L);
rndseed >>= 1;
if (res == 0x00000012 || res == 0x00000000) rndseed |= 0x80000000L;
return ((((int)(rndseed & 0x00007fffL)) % (max + 1 - min)) + min);
}
int Min (a, b)
int a, b;
{
return ((a > b) ? b : a);
}
int Max (a, b)
int a, b;
{
return ((a > b) ? a : b);
}